import { observable, action } from 'mobx';
import http from '../utils/api';
//import storage from '../utils/storage'


class Auth {
  @observable is_auth = false;
  @observable token = '';
  @observable user = {};

  @action async login(params) {
    let response = await http.post('login', params);

    this.is_auth = true;
    this.token = 'asfasfdas';
    this.user = { name: 'zxk' };
  }

  @action async logout(params) {

    this.is_auth = false;
    this.token = '';
    this.user = {};
  }

  @action async profile(params) {

  }
}


export default Auth;